package com.chendechao.model_home.adapter

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.chendechao.model_home.ui.HomeFragment

//新增HomePageAdapter类
class HomePagerAdapter(fragmentActivity: HomeFragment, val fragements:List<Fragment>):FragmentStateAdapter(fragmentActivity) {
    override fun getItemCount(): Int {
        return fragements.size
    }

    override fun createFragment(position: Int): Fragment {
        return fragements.get(position)
    }
}